from time import sleep
import user_data
from common.page import Page, IOS, XPATH
from net_project_tools.net_article_page import NetArticlePage
from net_project_tools.net_comm_page import NetCommPage
from net_project_tools.net_work_page import NetWorkPage



class tool(Page):
     def Worksend(self):
         self.page = NetArticlePage()
         self.page.login(*user_data.student1)
         self.page.enter_project()
         self.page.enter_tools('文章')
         self.page.release_article()  #发布文章
         sleep(5)
         self.page.view_comment_article()


     def WorkPing(self):
         self.page = NetArticlePage()
         self.page.login(*user_data.project_admin)  # 查阅
         self.page.enter_project()
         self.page.enter_tools('文章')
         # self.page.Caogao()   #发布草稿
         self.page.NetpageStudeng()

     def test_Send_comm(self):
         """交流工具"""
         self.page = NetCommPage()
         self.page.login(*user_data.zizhu_student)
         self.page.enter_project()
         self.page.enter_tools('交流')
         self.page.release_comm()
         self.page.CaoG()
         self.page.view_comment_comm()

     def test_commM(self):
         """交流工具"""
         self.page = NetCommPage()
         self.page.login(*user_data.student1)  # 学生发布草稿
         self.page.enter_project()
         self.page.enter_tools('交流')
         self.page.enter_comm()

     def test_send_work_release(self):
         """发布作业"""
         self.page = NetWorkPage()
         self.page.login(*user_data.project_admin)
         sleep(2)
         self.page.enter_project()
         self.page.enter_tools('作业')
         self.page.release_work()

     def test_submit_work_submit(self):
         """提交作业"""
         self.page = NetWorkPage()
         self.page.login(*user_data.student1)
         sleep(2)
         self.page.enter_project()
         self.page.enter_tools('作业')
         self.page.submit_work()

     def test_submit_work_zizhu(self):
         """提交作业"""
         self.page = NetWorkPage()
         self.page.login(*user_data.student1)
         sleep(2)
         self.page.enter_project()
         self.page.enter_tools('作业')
         self.page.submit_zizhu()

     def test_Piyue_work_view(self):
         """批阅作业"""
         self.page = NetWorkPage()
         self.page.login(*user_data.project_admin)
         sleep(2)
         self.page.enter_project()
         self.page.enter_tools('作业')
         self.page.view_work()